package com.rongc.client.freight;

import com.rongc.client.core.Constants;
import com.rongc.client.core.utils.SPUtil;

/**
 * Created by Bruce on 2017/6/24.
 */
public class ApiUrl {
    private static final String DEBUG_HOST = "http://47.94.156.140/sula/";
//    private static final String DEBUG_HOST = "http://47.93.18.21/sula/";
//    private static final String DEBUG_HOST = "http://192.168.199.129:8080/";


    private static final String ONLINE_HOST = "#";

    public static String getDefaultHost() {
        if (SPUtil.has("host")) {
            return SPUtil.getString("host",DEBUG_HOST);
        } else if (Constants.IS_DEBUG) {
            return DEBUG_HOST;
        } else {
            return ONLINE_HOST;
        }
    }

    // 获取验证码
    public static String getVerifyCodeUrl() {
        return getDefaultHost() + "appserver/index/sendVerifyCode";
    }

    // 登陆
    public static String getLoginUrl() {
        return getDefaultHost() + "appserver/index/login";
    }

    // 首页轮播
    public static String getBannerUrl() {
        return getDefaultHost() + "appserver/index/banners";
    }

    // 首页运单列表
    public static String getWayBillUrl() {
        return getDefaultHost() + "appserver/index/banners";
    }

    // 货主身份验证
    public static String getShipperVerifyUrl() {
        return getDefaultHost() + "appserver/index/shipperVerify";
    }

    // 司机身份验证
    public static String getDriverVerifyUrl() {
        return getDefaultHost() + "appserver/index/driverVerify";
    }

    // 获取字典信息
    public static String getDictsUrl() {
        return getDefaultHost() + "appserver/index/queryDicts";
    }

    // 货主发布货源
    public static String getPubSupplyUrl() {
        return getDefaultHost() + "appserver/goods/publishGoods";
    }

    // 司机添加车辆
    public static String getAddCarUrl() {
        return getDefaultHost() + "appserver/driver/addCarInfo";
    }

    // 司机获取车辆
    public static String getCarListUrl() {
        return getDefaultHost() + "appserver/driver/loadMimeCars";
    }

    // 司机发布车源
    public static String getPubConveyanceUrl() {
        return getDefaultHost() + "appserver/driver/publishCarInfo";
    }

    // 找车
    public static String getSearchDriversUrl() {
        return getDefaultHost() + "appserver/driver/searchDrivers";
    }

    // 发布货源后推荐车辆
    public static String getFindDriverUrl() {
        return getDefaultHost() + "appserver/driver/findDriver";
    }

    // 我的货源
    public static String getSupplyMyUrl() {
        return getDefaultHost() + "appserver/goods/loadMimeGoods";
    }

    // 我的货源
    public static String getWaybillDetailUrl() {
        return getDefaultHost() + "appserver/waybill/loadWaybillDetail";
    }


}
